<?php
/**
 * Created by PhpStorm.
 * User: pc
 * Date: 2025/2/24
 * Time: 9:29
 */

namespace app\modules\setting\configs\auth;


class SampleConfig
{

    /**
     * @return array
     * 获取搜索表单配置
     */
    public static function getSearchConfig(){
        return [
            [
                "component" => "FormInput",
                "field" => "name",
                "label" => "产品名称",
                "placeholder" => "产品名称",
                "allowClear" => true,
            ],

        ];
    }

    /**
     * @return array
     * 获取表格的操作
     */
    public static function getTableActions(){
        return  [

        ];
    }

    /**
     * @return array
     * 获取表格行的操作
     * [] 表示要id, ["*"] 表示要一行记录,参数名record, ["id"] 指定需要的参数 ， selected_ids 表示需要所有选择的id
     * configParamsField 规定请求的时候带上数据行中的那些参数，只需要字段名
     */
    public static function getTableRowAction(){
        return [

        ];
    }

    /**
     * @return array
     * 获取表格配置
     */
    public static function getTableConfig(){
        return [
            "rowKey" => "id",
            "columns" => [
                [
                    "title" => "产品名称",
                    "dataIndex" => "product_id",
                    "sorter" => true,
                    "key" => "product_id",
                    "format" => "raw",
                ],
                [
                    "title" => "产品信息",
                    "dataIndex" => "product_base",
                    "sorter" => true,
                    "key" => "product_base",
                    "format" => "raw",
                ],
                [
                    "title" => "商家",
                    "dataIndex" => "seller_id",
                    "sorter" => true,
                    "key" => "seller_id",
                    "format" => "raw",
                ],
                [
                    "title" => "商家信息",
                    "dataIndex" => "seller_info",
                    "sorter" => true,
                    "key" => "seller_info",
                    "format" => "raw",
                ],
                [
                    "title" => "机构",
                    "dataIndex" => "user_id",
                    "sorter" => true,
                    "key" => "user_id",
                    "format" => "raw",
                ],
                [
                    "title" => "机构信息",
                    "dataIndex" => "office_info",
                    "sorter" => true,
                    "key" => "office_info",
                    "format" => "raw",
                ],
                [
                    "title" => "发货地址",
                    "dataIndex" => "send_sample_address_id",
                    "sorter" => true,
                    "key" => "send_sample_address_id",
                    "format" => "raw",
                ],
            ],
            "actions" => self::getTableRowAction()
        ];
    }

    /**
     * 首页配置
     */
    public static function configIndex(){
        return [
            //搜索表单配置
            "searchConfig" => self::getSearchConfig(),
            // 操作配置 configParams 规定请求的时候带上那些参数
            "actionDivConfig" => self::getTableActions(),
            //表格配置
            "tableConfig" => self::getTableConfig(),
        ];
    }



}